import VueRouter from "vue-router"
import Index from "./components/Index.vue";
import Login from "./components/Login.vue"
const routes = [
    //一级路由
    {
        path: '/index',
        name: 'index',
        component: Index,
        redirect: '/',
        //路由嵌套
        children: [
            { path: '/index/ImgManager', component: () => import('./components/ImgManager.vue') },
            { path: '/index/LineManager', component: () => import('./components/LineManager.vue') },
            { path: '/index/UserManager', component: () => import('./components/UserManager.vue') }
        ]
    },
    { path: '/', component: Login }
]

const router = new VueRouter({
    mode: 'history',
    routes
})

export default router;